package com.example.demo1.wyy.controller;


import com.example.demo1.wyy.model.Plant;

import com.example.demo1.wyy.service.MPlantService;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.*;


import java.util.List;

/**
 * Created by Lx on 2018/6/27.
 */
@RestController
public class MLegalPersonController {


    @Autowired
    private MPlantService  mPlantService;
    /**
     * 查询所有工厂信息
     */
    @GetMapping("legalPersonPlant/queryAllPlant")
    public List<Plant> queryAllPlant(){

        return mPlantService.queryAll();

    }

/*    @PostMapping("/MlegalPersonPlant/addPlant")
    public Result<PlantAddVo> addPlant(@RequestBody @Valid PlantAddVo PlantAddVo, BindingResult bindingResult){
        if (bindingResult.hasErrors()){
            System.out.println(bindingResult.getFieldError().getDefaultMessage());
            return ResultVO.error(1,bindingResult.getFieldError().getDefaultMessage());
        }
        return mPlantService.addPlant(PlantAddVo);
    }*/

}
